package ModelLayer;



import static org.junit.Assert.assertEquals;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

/**
 * The test class ItemTest.
 *
 * @author  (your name)
 * @version (a version number or a date)
 */
public class ItemTest
{
    private ModelLayer.Item item1;

    /**
     * Default constructor for test class ItemTest
     */
    public ItemTest()
    {
    }

    /**
     * Sets up the test fixture.
     *
     * Called before every test case method.
     */
    @Before
    public void setUp()
    {
        item1 = new ModelLayer.Item("TestCode", "TestName", "TestType", 100, 10);
    }

    /**
     * Tears down the test fixture.
     *
     * Called after every test case method.
     */
    @After
    public void tearDown()
    {
    }

    @Test
    public void TestName()
    {
        assertEquals("TestName", item1.getName());
    }

    @Test
    public void TestType()
    {
        assertEquals("TestType", item1.getType());
    }

    @Test
    public void TestCode()
    {
        assertEquals("TestCode", item1.getItemCode());
    }

    @Test
    public void TestPrice()
    {
        assertEquals(100, item1.getPrice(), 0.1);
    }

    @Test
    public void TestDiscount()
    {
        assertEquals(10, item1.getDiscount(), 0.1);
    }
}





